package com.tanhua.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.domain.AnalysisByDay;
import org.apache.ibatis.annotations.Select;

public interface AnalysisByDayMapper extends BaseMapper<AnalysisByDay> {
    @Select("SELECT SUM(num_registered) FROM tb_analysis_by_day")
    Integer sumOfAllTheRegistered();

    @Select("SELECT num_registered FROM tb_analysis_by_day WHERE record_date = #{date}")
    Integer registeredByDay(String date);

    @Select("SELECT num_active FROM tb_analysis_by_day WHERE record_date = #{date}")
    Integer activeByDay(String date);

    @Select("SELECT num_login FROM tb_analysis_by_day WHERE record_date = #{date}")
    Integer loginByDay(String date);

    @Select("SELECT num_retention1d FROM tb_analysis_by_day WHERE record_date = #{date}")
    Integer retentionByDay(String date);
}
